package com.cx.zyx.modulebiz.news.service.mq;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@RocketMQMessageListener(
        topic = "delay-news-topic",
        consumerGroup = "delay-news-group",
        selectorType = SelectorType.TAG,
        selectorExpression = "DELAY",
        instanceName = "DelayNewsConsumer",
        consumeMode = ConsumeMode.CONCURRENTLY // 并行发消费模式
)
public class NewDelayedConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        log.info("接收延迟消息: {}", message);
    }
}
